package jp.co.cos.ittrick.channel.controller.admin;

import jp.co.cos.ittrick.channel.service.PageService;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

public class PageDeleteController extends Controller {

    private PageService pageService;

    public PageDeleteController() {
        pageService = new PageService();
    }

    @Override
    public Navigation run() throws Exception {

        // リクエストパラメータ
        String channel = asString("channel");
        String page = asString("page");

        // Insert
        pageService.delete(Integer.valueOf(page));

        return redirect("/admin/channel?channel=" + channel);
    }
}
